-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: find the chosen okta mfa option in the mfaOptions #1133
Conversation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #1133 +/- ##
==========================================
+ Coverage 37.19% 39.00% +1.81%
==========================================
Files 53 53
Lines 7959 7963 +4
==========================================
+ Hits 2960 3106 +146
+ Misses 4619 4442 -177
- Partials 380 415 +35
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - do you mind adding tests to this? This is going to push the coverage down and make the build to fail
* origin/mfa-options: chore(deps): bump github.com/tidwall/gjson from 1.16.0 to 1.17.0 fix: find the chosen mfa option in the mfaOptions chore(deps): bump github.com/aws/aws-sdk-go from 1.45.7 to 1.45.12
Sure! here is a test. Can you give me some feedback about the fixtures, i haven't trimmed them down to only the fields that are referenced in the okta.go calls, if you like i can do that. I left them with more information rather than less in the hope that future readers would be able to improve the logic without needing access to fresh raw responses from duo. But each to their own, would you like them trimmed? |
I personally think we should trim them down so that the test is focused on what it is testing. The extra context can be confusing. @gliptak thoughts? |
i'm cool with doing that, i'll update the PR later today. I'm a bit on the fence personally so it's not a big deal |
ok, this is ready for review again, I have extended the test suite to assert all the server request's and trimmed down the fixtures |
@russell This has been released |
find the index of the a duoMfaOption by looking in the duoMfaOptions.
the duoMfaOptions is dynamically created, so it could have any number of items, the reason that using the interactively selected mechanism works is that it's choosing based on the list of duoMfaOptions options rather than hardcoded ids. This change does something similar, but searches through duoMfaOptions to find the option passed at the CLI, if the item is missing, then an error will be emitted.
for example if I don't have passcode enabled and if i try to force that option
fixes #1079 #1061